package com.jhgsys.internal.sypq.controller;

import com.jhgsys.internal.common.authentication.ShiroHelper;
import com.jhgsys.internal.common.controller.BaseController;
import com.jhgsys.internal.common.entity.FebsConstant;
import com.jhgsys.internal.sypq.entity.*;
import com.jhgsys.internal.sypq.service.IHomeService;
import com.jhgsys.internal.sypq.service.IResourceService;
import com.jhgsys.internal.system.entity.User;
import com.jhgsys.internal.system.service.IUserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * 待办通知表 Controller
 *
 * @author ganjun
 * @date 2024-11-30 21:43:28
 */
@Slf4j
@Validated
@Controller
public class HomeController extends BaseController {
    @Autowired
    IResourceService resourceService;
    @Autowired
    IHomeService homeService;
    @Autowired
    private IUserService userService;
    @Autowired
    private ShiroHelper shiroHelper;

    @GetMapping(value = "home/resourceList")
    @ResponseBody
  //  @RequiresPermissions("home:view")
    public List   resourceList() {
        List<ResourceDto> resourceList = this.homeService.getResourceList();
        return     resourceList;
    }

    @GetMapping(value = "home/resourceData")
    @ResponseBody
 //   @RequiresPermissions("home:view")
    public Map   getResourceData(@Param("resourceid")String resourceid,@Param("weidu")String weidu) {
          Map  map=homeService.getResourceData(resourceid,weidu);
        return     map;
    }


    @GetMapping(value = "home/shipData")
    @ResponseBody
  //  @RequiresPermissions("home:view")
    public Map getShipData() {
        Map  map=homeService.getShipData();
        return     map;
    }

    @GetMapping(value = "home/scheduleStatusNum")
    @ResponseBody
 //   @RequiresPermissions("home:view")
    public Map getScheduleStatusNum() {
        Map<String,String>  taskdata=this.homeService.getScheduleStatusNum();
         return  taskdata;
    }
}
